package com.example.module_filemanage.Base;

import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.widget.DrawerLayout;
import android.util.Log;

import com.example.module_base.Base.BaseFragment;
import com.example.module_filemanage.MVVM.View.FMMainActivity;

import static android.content.ContentValues.TAG;

/**
 * Created by SJ on 2018/4/21.
 */

public abstract class FM_BaseFragment extends BaseFragment<ViewDataBinding> {
    public static int fragments=0;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        fragments++;
    }
    @Override
    public void onDestroy() {
        fragments--;
        Log.e(TAG, "onDestroy: "+fragments );
        if (fragments==0){
            ((FMMainActivity)getActivity()).binding.drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
        }
        super.onDestroy();
    }
}
